<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script>
		
		arr = [5,8,6,9,675,423,2,1];

		function sort(inArr) {
			for(var j=0;j<inArr.length;j++){
				for (var i = 0; i < inArr.length-1; i++) {
					if(inArr[i]>inArr[i+1]){
						temp = inArr[i];
						inArr[i] =  inArr[i+1];
						inArr[i+1] = temp;
					}
				}
			}

			return inArr;
		}


		res = sort(arr);

		// document.write(res);
		

		arr = [4,32,54,4,3,3,3,3,54,43,4]

		
		function unqiun(inArr) {
			
			for (var i = 0; i < inArr.length; i++) {

				for (var k = i+1; k < inArr.length; k++) {
					if(inArr[k]==inArr[i]){
						inArr.splice(k,1);
						k--;
					}
				}
			}
			return inArr;
		}

		res = unqiun(arr);

		// document.write(res);
		// 
		str = "dfKdfDFdF";

		function change(str) {
			
			temp = '';
			for (var i = 0; i <str.length; i++) {
				if(str[i].toUpperCase()==str[i]){
					temp += str[i].toLowerCase()
				}else{
					temp += str[i].toUpperCase()
				}
			}
			return temp;
		}

		document.write(str+"<br>");

		res = change(str);

		document.write(res);












	</script>
</head>
<body>
	
</body>
</html>